#!/usr/bin/bash

# key: $mod+Escape

key=$1

default="off"

# ARGUMENTS FOR HELP:
if [[ "" == $key ]] ; then
	bash ~/.sis/bin/sis-net-help

	# key=$default # - default # or:
	echo empty key
	exit `false` # close this with error
elif [[ "--help" == $key || "--name" == $key || "--version" == $key || "--info" == $key  ||  "--usage" == $key ]] ; then
	bash ~/.sis/bin/sis-net-help $key
	
	exit `true` # close  - becose this help-run
fi

# NEtWORK KEYS:
if [[ "on" == $key ]] ; then
	# wifi replace to on:
	echo wifi on # move to wifi::on
	bash ~/.sis/bin/sis-toogle wifi on

	# usb replace to on:
	echo usb on # move to usb::on
	bash ~/.sis/bin/sis-toogle usb on

	# lan replace to on:
	echo lan on # move to lan::on
	bash ~/.sis/bin/sis-toogle lan on

elif [[ "off" == $key ]] ; then
	# wifi replace to off:
	echo wifi off # move to wifi::off
	bash ~/.sis/bin/sis-toogle wifi off

	# usb replace to off:
	echo usb off # move to usb::off
	bash ~/.sis/bin/sis-toogle usb off

	# lan replace to off:
	echo lan off # move to lan::off
	bash ~/.sis/bin/sis-toogle lan off

# MAYBE DELETE: - for simple control select device on network
elif [[ "wifi" == $key || "usb" == $key || "lan" == $key ]] ; then
	# wifi\lan\usb replace to off:
	echo $key $2 # move to wifi::off
	bash ~/.sis/bin/sis-toogle $key $2

# 
else
	echo undefine key
	exit `false` # 
fi

exit `true`

